package com.gy.componit;

import com.gy.game.Game;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.awt.*;

/**
 * 地块
 * @author Dsy
 * @create 2022-02-03  5:25
 */
@AllArgsConstructor
@Data
@NoArgsConstructor
public class Plot implements Component{

    private int x,y;
    private int col,row;
    private int size;
    private Team team;
    private Color color = Color.gray;

    @Override
    public void paint(Graphics g) {
        g.setColor(team == null ? color : team.getTeamPlotColor());
        g.fillRect(x,y,size,size);
        g.setColor(Color.BLACK);
        g.drawRect(x,y,size,size);

    }

    @Override
    public AreaPoint getAreaPoint(int areaSize) {
        return null;
    }

    @Override
    public void move(Game game) {

    }

    @Override
    public int getOrder() {
        return -100;
    }
}
